package com.sf.protal.common.log.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.sf.protal.admin.dao.SysLogMapper;
import com.sf.protal.common.log.SysLog;
import com.sf.protal.common.log.controller.SysLogController;
import com.sf.protal.common.log.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysLogServiceImpl implements SysLogService {

	@Autowired
	private SysLogMapper sysLogMapper;

	@Override
	public void addLog(SysLog log) {
		sysLogMapper.insert(log);
	}

	@Override
	public void putLog(SysLog log) {
		SysLog sysLog = new SysLog();
		EntityWrapper<SysLog> wrapper = new EntityWrapper<>();
		wrapper.eq("logId",log.getLogId());
		sysLogMapper.update(sysLog,wrapper);
	}
}
